package com.imooc.mall.service;

import com.github.pagehelper.PageInfo;
import com.imooc.mall.model.pojo.Category;
import com.imooc.mall.model.request.AddCategoryReq;
import com.imooc.mall.model.vo.CategoryVO;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author yijiu
 * @version 1.0
 * @description: 分类目录Service
 * @date 2022/2/27 0:25
 */
@Service
public interface CategoryService {
    void add(AddCategoryReq addCategoryReq);

    void update(Category updateCategory);

    void delete(Integer id);

    PageInfo listForAdmin(Integer pageNum, Integer pageSize);


    @Cacheable(value = "listCategoryForConsumer" )   //选择springframework提供的
    List<CategoryVO> listCategoryForConsumer(Integer parentId);
}
